﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Employee/MasterPageEmployee.master" AutoEventWireup="true" CodeFile="CreateInterview.aspx.cs" Inherits="Employee_CreateInterview" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link rel="Stylesheet" type="text/css" href="Styles/EmployeeStyleSheet.css" />
    <script type="text/javascript" src="../Scripts/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#<%=ddltitlevacancy.ClientID %>').blur(function () {
                if ($('#<%=ddltitlevacancy.ClientID %>').val() == "Please choise title vacancy") {
                    $('#<%=lblErrortitlevacancy.ClientID %>').html("(*)");
                }
                else {
                    $('#<%=lblErrortitlevacancy.ClientID %>').html("");
                }
                hidebutton();
            });
            $('#<%=ddlApplicant.ClientID %>').blur(function () {
                if ($('#<%=ddlApplicant.ClientID %>').val() == "Please choise Applicant") {
                    $('#<%=lblErrorApplicant.ClientID %>').html("(*)");
                }
                else {
                    $('#<%=lblErrorApplicant.ClientID %>').html("");
                }
                hidebutton();
            });
            $('#<%=ddlInterviewer.ClientID %>').blur(function () {
                if ($('#<%=ddlInterviewer.ClientID %>').val() == "Please choise Interviewer") {
                    $('#<%=lblErrorInterviewer.ClientID %>').html("(*)");
                }
                else {
                    $('#<%=lblErrorInterviewer.ClientID %>').html("");
                }
                hidebutton();
            });
            $('#<%=txtDateInterview.ClientID %>').blur(function () {
                if ($('#<%=txtDateInterview.ClientID %>').val() == "") {
                    $('#<%=lblErrorDateInterview.ClientID %>').html("(*)");
                }
                else {
                    $('#<%=lblErrorDateInterview.ClientID %>').html("");
                }
                hidebutton();
            });
            $('#<%=txtTimeStart.ClientID %>').blur(function () {
                if ($('#<%=txtTimeStart.ClientID %>').val() == "") {
                    $('#<%=lblErrorTime.ClientID %>').html("(*)");
                }
                else {
                    $('#<%=lblErrorTime.ClientID %>').html("");
                }
                hidebutton();
            });
            function hidebutton() {
                if ($('#<%=ddltitlevacancy.ClientID %>').val() == "Please choise title vacancy") {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else if ($('#<%=ddlApplicant.ClientID %>').val() == "Please choise Applicant") {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else if ($('#<%=ddlInterviewer.ClientID %>').val() == "Please choise Interviewer") {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else if ($('#<%=txtDateInterview.ClientID %>').val() == "") {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else if ($('#<%=txtTimeStart.ClientID %>').val() == "") {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', false);
                }
            };
            $('#<%=txtDateInterview.ClientID %>').click(function () {
                $('#DivCalendar').css('display', 'block');
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceholder" Runat="Server">
    <div id="MainCreateInterview">
        <h2>Create a new Interview</h2>
        <p>
            <asp:Label ID="lblVacancy" runat="server" Height="20px" 
                Width="180px">Title Vacancy:</asp:Label>
            <asp:DropDownList ID="ddltitlevacancy" runat="server" 
                CssClass="CVinput" Height="20px" Width="204px" AutoPostBack="True" 
                onselectedindexchanged="ddltitlevacancy_SelectedIndexChanged">
                <asp:ListItem Selected="True">Please choise title vacancy</asp:ListItem>
            </asp:DropDownList>
            <asp:Label ID="lblErrortitlevacancy" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblAplicant" runat="server" Text="Applicant Name:" Height="20px" 
                Width="180px"></asp:Label>
            <asp:DropDownList ID="ddlApplicant" runat="server" Height="20px" Width="204px">
                <asp:ListItem Selected="True">Please choise Applicant</asp:ListItem>
            </asp:DropDownList>
            <asp:Label ID="lblErrorApplicant" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblInterviewer" runat="server" Text="Interviewer:" Height="20px" 
                Width="180px"></asp:Label>
            <asp:DropDownList ID="ddlInterviewer" runat="server" Height="20px" 
                Width="204px">
                <asp:ListItem Selected="True">Please choise Interviewer</asp:ListItem>
            </asp:DropDownList>
            <asp:Label ID="lblErrorInterviewer" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblDateInterview" runat="server" Text="Date Interview:" 
                Height="20px" Width="180px"></asp:Label>
            <asp:TextBox ID="txtDateInterview" runat="server" CssClass="CVinput" 
                Height="20px" Width="200px"></asp:TextBox>
            <asp:Label ID="lblErrorDateInterview" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <div id="DivCalendar">
            <asp:Calendar ID="Calendar1" runat="server" 
                onselectionchanged="Calendar1_SelectionChanged" BackColor="White" 
                BorderColor="#3366CC" BorderWidth="1px" CellPadding="1" 
                DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" 
                ForeColor="#003399" Height="200px" Width="220px">
                <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
                <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
                <OtherMonthDayStyle ForeColor="#999999" />
                <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
                <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" 
                    Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
                <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
                <WeekendDayStyle BackColor="#CCCCFF" Wrap="False" />
            </asp:Calendar>
        </div>
        <p>
            <asp:Label ID="lblTimeDetails" runat="server" Text="Time Details:" 
                Height="20px" Width="180px"></asp:Label>
            <asp:TextBox ID="txtTimeStart" runat="server" CssClass="CVinput" 
                Width="200px"></asp:TextBox>
                <asp:Label ID="lblErrorTime" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblEmployeeCreate" runat="server" Text="Employee Create:" 
                Height="20px" Width="180px"></asp:Label>
            <asp:TextBox ID="txtEmployeeCreate" runat="server" CssClass="CVinput" 
                Width="200px" Enabled="False"></asp:TextBox>
        </p>
        <p>
            <asp:Label ID="lblStatus" runat="server" Text="Status:" Height="20px" 
                Width="180px"></asp:Label>
            <asp:DropDownList ID="ddlStatus" runat="server" CssClass="CVinput" 
                Height="20px" Width="100px" Enabled="False">
                <asp:ListItem Selected="True">Suspeded</asp:ListItem>
            </asp:DropDownList>
        </p>
        <p style="text-align: center;"><asp:Label ID="lblError" runat="server" Text="" ForeColor="Red"></asp:Label>
            <asp:Label ID="lblSuccess" runat="server" ForeColor="Blue"></asp:Label>
        </p>
        <p id="button">
            <asp:Button ID="btnCreate" runat="server" Text="Create" Height="30px" 
                Width="100px" onclick="btnCreate_Click" ToolTip="Create new Vacancy" />
            <asp:Button ID="btnClear" runat="server" Text="Clear" Height="30px" 
                Width="100px" onclick="btnClear_Click" ToolTip="Clear all textbox" />
        </p>
    </div>
</asp:Content>

